package com.netcracker.studportal.server.main_test;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import org.json.simple.parser.JSONParser;

import com.netcracker.studportal.server.facade.FacadeStudent;
import com.netcracker.studportal.server.model.Exam;
import com.netcracker.studportal.server.model.Faculty;
import com.netcracker.studportal.server.model.Material;
import com.netcracker.studportal.server.model.Student;
import com.netcracker.studportal.server.util.FactoryDAO;

public class MainFacadeStudent {
	public static void main(String args[]){
		FacadeStudent fa= new  FacadeStudent();
		try{
			
		JSONObject obj = new JSONObject();
					
		Student stud=new Student();
		stud.setId(new Long(4));
		//stud.setBirthday(new Date());
		//stud.setCourse(1);
		//Faculty f = new Faculty();
		//f.setId(new Long(1));
		//stud.setFaculty(f);
		//stud.setFirst_name("aaa");
		//stud.setLast_name("nnn");
		//stud.setGroup_num(1);
		//stud.setNote("note");
		
		obj=stud.kJSON();
		
	//	String str1=fa.getExamsByStudent(obj.toString());
	//	JSONParser parser=new JSONParser();	
	//	Object ob=parser.parse(str1);
	//	JSONArray array=(JSONArray)ob;

		JSONObject obj1 = new JSONObject();
		
		obj1.put("material_id", "8");
		String str=fa.loadMaterialByID(obj1.toString());
		System.out.println("str "+str);
		
	//	obj.put("exam_id","2");		
	//	String str=fa.getSubjectByExam(obj.toString());
		
		//obj.put("exam_id", "2");		
	//	String str=fa.getMaterialsByExam(obj.toString());
	//	System.out.println("str "+str);
		
		//obj.put("exam_id", "2");	
		//String str1=fa.getProfByExam(obj.toString());
		//System.out.println("str "+str1);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
